﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DbAttributes
{
    /// <summary>
    /// 不映射到数据库
    /// </summary>
    public class NotMapperAttribute : Attribute
    { }




    /// <summary>
    /// 主键
    /// </summary>
    public class KeyAttribute : Attribute
    {
    }


    /// <summary>
    /// 不为Null
    /// </summary>
    public class NotNullAttribute : Attribute
    { }


    /// <summary>
    /// 表名
    /// </summary>
    public class TablNameAttribute : Attribute
    {
        public TablNameAttribute(string name)
        {
            this.TableName = name;
        }

        public string TableName { get; set; }

    }


    /// <summary>
    /// 列属性
    /// </summary>
    public class ColumnAttribute : Attribute
    {


        public ColumnAttribute(int Length)
        {
            this.ColumnLength = Length;
        }

        public ColumnAttribute(int MinLength, int MaxLength)
        {
            this.ColumnMinLength = MinLength;
            this.ColumnMaxLength = MaxLength;
        }

        public int ColumnMaxLength { get; set; }

        public int ColumnMinLength { get; set; }


        public int ColumnLength { get; set; }


    }

}
